<template>
  <div class="standalone-container">
    <report-detail :userId="userId" :taskId="taskId" :standalone="true"></report-detail>
  </div>
</template>

<script>
import ReportDetail from '@/views/report/student/detail';

export default {
  name: 'StandaloneReport',
  components: { ReportDetail },
  data() {
    return {
      userId: '',
      taskId: ''
    };
  },
  created() {
    // 从URL查询参数中获取userId和taskId
    this.userId = this.$route.query.userId;
    this.taskId = this.$route.query.taskId;
    
    if (!this.userId || !this.taskId) {
      this.$message.error('缺少必要的参数');
    }
    
    // 设置页面标题
    document.title = '心理健康测评报告';
    
    // 添加viewport meta标签，确保移动端显示正常
    this.setViewport();
  },
  methods: {
    setViewport() {
      let meta = document.createElement('meta');
      meta.name = 'viewport';
      meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0';
      document.getElementsByTagName('head')[0].appendChild(meta);
    }
  }
};
</script>

<style scoped>
.standalone-container {
  height: 100%;
  min-height: 100vh;
  background-color: #f5f7fa;
  padding: 20px;
}

@media (max-width: 768px) {
  .standalone-container {
    padding: 10px;
  }
}
</style> 